 {include file="index@public/header" /}
  <style>
      body {
      background: #e1e0de;
    }
    * {
      box-sizing: border-box;
    }
h1,
h2,
h3,
h4 {
  font-weight: 700 !important;
}
.layui-card-header {
  width: 100%;
  border-bottom: 1px solid #999 !important;
  padding-left: 5px;
}
.layui-card {
  padding: 10px 20px 50px;
}

.layui-container {
  padding: 0 !important;
}
img {
  max-width: 100%;
}
::-moz-selection {
  background: #cccccc;
  color: #ffffff;
}
::selection {
  background: #cccccc;
  color: #ffffff;
}
.layui-breadcrumb {
  padding-left: 5px;
}
.layui-card h1 {
  margin: 10px auto 0;
}
.description {
  font-size: 15px;
  font-weight: bold;
  margin: 20px 0;
}

.content {
  font: 12px/14px arial,helvetica,sans-serif;
  color: #333333;
  line-height: 20px;
}
.content >div{
  margin: 20px 0;
}
@media screen and (max-width: 800px) {
  .layui-card-header {
    line-height: normal !important;
    font-size: 10px !important;
  }
}

     
    .layui-card-body{
        padding: 10px 5px;
    }
.layui-card-body .layui-col-sm3{margin:5px 0px;}
.layui-card-body .layui-col-sm3 a{display:block;}
.layui-card-body .layui-col-sm3 a:hover{color:#36648A;}
.layui-card-body .layui-col-sm3 .plist{width: 95%;border:1px solid #ccc;border-radius: 8px;padding:5px;height:148px;overflow:hidden}
.layui-card-body .layui-col-sm3 a:hover .plist{border:1.5px solid #36648A;}
.layui-card-body .layui-col-sm3 .plist .plist-title{padding-bottom:3px;font-family: Titillium Web,sans-serif;font-size:15px;padding-left:5px}
.layui-card-body .layui-col-sm3 .plist img{width:100%;padding:2px}
.layui-card-body .layui-col-sm3 .plist .layui-col-sm9{font: 12px/14px arial,helvetica,sans-serif;color: #333;line-height: 1.42857143;padding:2px;}
@media screen and (max-width: 768px) {
  h1{font-size:14px;}
}
.layui-card-body a{text-decoration:none;}
#gengduoli1> *{
    margin: unset;
    padding: revert;
    list-style: revert;
  }
    </style>
  
  <!-- Ceramic Bearings内容适配手机 -->
  <style type="text/css">
    @media screen and (max-width: 767px) {
      .plist{
        display: flex;
        flex-wrap: wrap;
        width: 100% !important;
      }
      .plist-title{
        width: 100%;
        padding-bottom: 0 !important;
        height: 1.56rem;
      }
      .plist>div:nth-child(2){
        width: 25%;
        padding: 0.43rem 0 0 0 !important; 
      }
      .plist>div:nth-last-child(1){
        width: 75%;
      }
      .layui-card{
            padding: 10px 5px 50px !important;
      }
      .layui-breadcrumb{
        margin-top: 20px;
      }
    }
  </style>


<div class='phone-list' style='font: 12px/14px arial,helvetica,sans-serif;padding:10px;background-color: #ffffff;'>
<div class='firstbreadcrumb' style="padding: 10px;">
  {foreach $crumbs as $k=>$v }
    <?php if($k!=count($crumbs)-1){?>
    <a href="/{$v['crumbs_url']}" style="font: 14px arial,helvetica,sans-serif;color:#36648A;padding-right: 8px;display: inline-block;height: 48px;line-height: 48px">{$v['alias_name']}</a> <span style="padding-right:8px;padding-bottom: 8px;display: inline-block;"> / </span>
    <?php }else{ ?>
    <span style="font: 14px arial,helvetica,sans-serif;color: #666;"><cite>{$class_info['alias_name']}</cite></span> 
    <?php } ?>  
  {/foreach} 
</div>


 
  
  <div style="padding:12px 0px">
    <div>
      <h1 style="font-size:16px;font-weight:bold;">{$class_info['alias_name']}</h1>
    </div>
    <div style="padding:3px 0px">
      
      {foreach $listkey as $key=>$vo }

      <?php if($vo['wname']=='Bore Dia'||$vo['wname']=='Outer Dia'||$vo['wname']=='Width'){?>
      <?php if(!empty($vo['data'])){?>
      <select style="width:24%;height:30px;" onchange="window.location=this.value">
        <option>{:lang(trim($vo['wname']))}</option>
        {foreach $vo['data'] as $k1=>$v1 }
        <?php if(!empty($v1['key'])&&$v1['key']!=''){ ?>

        <?php 
          if($vo['is_nosearch']==1){
            $nosearch=Db::table('lily_listkey_nosearch')->field('url')->where([['list_key_id','=',$vo['id']],['value','=',$v1['key']]])->find();
            if(!empty($nosearch)){
              $shai_url=$nosearch['url'];
            }else{
              $shai_url='';
            }
          }else{
            if(empty($get)){
                $shai_url=$base_data['no_parameter_url'].'?'.trim(str_replace(' ','_',$vo['wname'])).'='.trim($v1['key']);
            }else{
                $shai_url=$base_data['no_parameter_url'].'?';
                foreach ($get as $getkey => $getvalue) {
                    if($getkey=='part_number'){ $getkey='p';}
                      if($getkey!=str_replace(' ','_',$vo['wname'])){
                          $shai_url.=$getkey.'='.$getvalue.'&';
                      }
                }
                if(isset($get[str_replace(' ','_',$vo['wname'])]) && $get[str_replace(' ','_',$vo['wname'])]==$v1['key']){
                    $shai_url=rtrim(rtrim($shai_url,'&'),'?');
                }else{
                    $shai_url=$shai_url.trim(str_replace(' ','_',$vo['wname'])).'='.trim($v1['key']);
                }
            }
          } ?>
           
          <?php if(isset($get[str_replace(' ','_',$vo['wname'])]) && $get[str_replace(' ','_',$vo['wname'])]==$v1['key'] ){?>
          <option value="{$shai_url}" selected="selected">{:lang($v1['key'])}</option>
          <?php }else{ ?>
          <option value="{$shai_url}">{:lang($v1['key'])}</option>
          <?php } ?>
            
         
        <?php }?>
        {/foreach}
        
      </select>
      <?php } ?>
      <?php } ?>
      {/foreach}
      
      <div style="width:25%;float:right;">
        <button style="height:30px;width:100%;" style="button" id="select_more_wd_a">更多筛选</button>
        <button style="height:30px;width:100%;display:none;" style="button" id="select_more_wd_b">关闭筛选</button>
      </div>
      
      <div class='clear'></div>
      <div style='display:none;' id="more_wd">
        <div style='width:100%;border:1px solid black;background-color:#efefef;padding:2px 0px;color:#333333;max-height:100px;overflow-x: hidden;;overflow-y:auto;z-index:10;font-size:14px;'>
          {foreach $listkey as $key=>$vo }
          <?php if($vo['wname']!='Bore_Dia'&&$vo['wname']!='Outer_Dia'&&$vo['wname']!='Width'){?>
          <?php if(!empty($vo['data'])){?>
          <select style="height:30px;margin:3px 0px;" onchange="window.location=this.value">
            <option>{:lang(trim($vo['wname']))}</option>
            {foreach $vo['data'] as $k1=>$v1 }
            <?php if(!empty($v1['key'])&&$v1['key']!=''){ ?>
            <?php 
              if($vo['is_nosearch']==1){
                $nosearch=Db::table('lily_listkey_nosearch')->field('url')->where([['list_key_id','=',$vo['id']],['value','=',$v1['key']]])->find();
                if(!empty($nosearch)){
                  $shai_url=$nosearch['url'];
                }else{
                  $shai_url='';
                }
              }else{
                if(empty($get)){
                    $shai_url=$base_data['no_parameter_url'].'?'.trim(str_replace(' ','_',$vo['wname'])).'='.trim($v1['key']);
                }else{
                    $shai_url=$base_data['no_parameter_url'].'?';
                    foreach ($get as $getkey => $getvalue) {
                        if($getkey=='part_number'){ $getkey='p';}
                          if($getkey!=str_replace(' ','_',$vo['wname'])){
                              $shai_url.=$getkey.'='.$getvalue.'&';
                          }
                    }
                    if(isset($get[str_replace(' ','_',$vo['wname'])]) && $get[str_replace(' ','_',$vo['wname'])]==$v1['key']){
                        $shai_url=rtrim(rtrim($shai_url,'&'),'?');
                    }else{
                        $shai_url=$shai_url.trim(str_replace(' ','_',$vo['wname'])).'='.trim($v1['key']);
                      }
                  }
               }?>
          
            <?php if(isset($get[str_replace(' ','_',$vo['wname'])]) && $get[str_replace(' ','_',$vo['wname'])]==$v1['key']){?>
                      <option value="{$shai_url}" selected="selected">{:lang($v1['key'])}</option>
            <?php }else{ ?>
            <option value="{$shai_url}">{:lang($v1['key'])}</option>
            <?php } ?>

            <?php }?>
        {/foreach}
          </select>
          <?php } ?>
          <?php } ?>
          {/foreach}
        </div>
      </div>
      
    <div class="layui-card-body">
          <div class="layui-row">
            
            
            <?php if(!empty($class_tag)){?>
            {foreach $class_tag as $k=>$v }
            <?php if($v['is_show']==1){?>
            <div>
              
             
              
              <div class="layui-col-sm3 layui-col-xs12">
                <a href="/{$v['class_url']}">
                  <div class='plist'>
                    <div class='plist-title'>{$v['alias_name']}</div>
                    <div class="layui-col-sm3"><img src="{:Config::get('app.images_host').$v['img']}" alt="{$v['alias_name']}"></div>
                    <div class="layui-col-sm9">{$v['block_des']}</div>
                  </div>
                </a>
              </div>
              
              <div style="clear: both;"></div>
            </div>
            <?php } ?>
            {/foreach}
            <?php } ?>
            
          </div>
        </div>
  </div>
</div>


{include file="index@public/footer" /}
<script>
  layui.use("element", function () {
    var element = layui.element;
        
  });
  var LAY_demo1_width=$("#LAY_demo1").width();
  $('#demo3').width(LAY_demo1_width);
</script>

<script type="text/javascript">
 $(document).ready(function(){
  $("#deltail_des_a").click(function(){
    $("#deltail_des_c").show();
    $("#deltail_des_a").hide();
    $("#deltail_des_b").show();
  });
  $("#deltail_des_b").click(function(){
    $("#deltail_des_c").hide();
    $("#deltail_des_a").show();
    $("#deltail_des_b").hide();
  });

  $("#select_more_wd_a").click(function(){
    $("#more_wd").show();
    $("#select_more_wd_a").hide();
    $("#select_more_wd_b").show();
  });
  $("#select_more_wd_b").click(function(){
    $("#more_wd").hide();
    $("#select_more_wd_a").show();
    $("#select_more_wd_b").hide();
  });
});


function clearall() {
    layer.load(1, {
      shade: [0.1, '#fff'],
      success: function() {
        setTimeout(function() {
          var url = window.location.href; //获取当前页面的url
          if (url.indexOf("?") != -1) { //判断是否存在参数
            url = url.replace(/(\?|#)[^'"]*/, ''); //去除参数
          }
          window.location.href = url;
        }, 1000);
      }
  });
}

/*单个清空*/
function del_search($k, $v) {
    if($k=='Part_Number'){
      $k='p';
    }
    var url = window.location.href; //获取当前页面的url
    let arrUrl = [];
    let changUrl = ''
    if (url.indexOf("?") != -1) { //判断是否存在参数
      arrUrl = url.split('?')[1].split('&')
      //获取参数转换为object
      for (var i = 0; i < arrUrl.length; i++) {
        arrUrl[i] = arrUrl[i].split("=");
      };
      for (var i = 0; i < arrUrl.length; i++) {
        if(arrUrl[i][0]==encodeURI($k)){
                    arrUrl.splice(i,1);
        }
      }
      if(arrUrl.length == 0){
        url = url.split('?')[0];
      }else{
        for (var i = 0; i < arrUrl.length; i++) {
          changUrl+=arrUrl[i][0]+'='+arrUrl[i][1]+'&';
        }

        url=url.split('?')[0]+'?'+changUrl.slice(0, changUrl.length - 1);
      }
      window.location.href=url;
    }
}

</script>
